{% extends "base.html" %}

{% block title %} {{entry.title|escape}} - {{blog.title|escape}} {% endblock %}

{% block head_block %}

{% if entry %}
{%if entry.strtags%}<meta name="Keywords" content="{{entry.strtags|escape}}" />{%endif%}
{%if entry.excerpt%} <meta name="Description" content="{{entry.excerpt|escape}}" />{%endif%}
{% endif %}

{% endblock %}

{% block content %}

<!-- content start -->
<div id="content">
	{% if entry %}
	<div class="posthead box">
		<a href="/" title="Back to Home">Home</a> &raquo; {% if entry.categories %}{%for cate in entry.categories%} <a href="/category/{{cate.slug}}">{{cate.name}}</a> {%endfor%} &raquo; {% endif %}{{ entry.title|escape }}
	</div>
	
	<div class="post box" id="post-{{entry.key}}">
		<h1 class="post-title">
		<a href="/{{entry.link|escape}}" title="{{ entry.title|escape }}" rel="bookmark">
			{{ entry.title|escape }}
		</a>
		</h1>
		<div class="postmeta">
			<ul>
				<li class="meta-date">{{entry.date|datetz:"Y/m/d H:i"}}</li>
				
				<li class="meta-views">{{entry.readtimes}} 次阅读</li>
				
				<li class="meta-cat">
				{%for cate in entry.categories%} <a href="/category/{{cate.slug}}">{{cate.name}}</a> {%endfor%}
				</li>
				<li class="meta-comments">
				<a href="/{{entry.link|escape}}#comments">{{entry.commentcount}} 条评论</a>
				</li>
			</ul>
			<div class="clear"></div>
		</div>
		<div class="post-content">
			{{ entry.content }}
			<div class="clear"></div>
		</div>
		<div class="copy">
			<p><b>转载请注明：来自</b><a href="{{blog.baseurl}}" title="{{blog.title|escape}}">{{blog.title|escape}}</a>
			<br/><b>本文地址：</b><a href="{{blog.baseurl}}/{{entry.link|escape}}" title="{{ entry.title|escape }}">{{blog.baseurl}}/{{entry.link|escape}}</a></p>
		</div>
		{% if entry.tags%}		
		<p class="post-tags">Tags:
			{%for tag in entry.tags%}
				<a href="/tag/{{tag|urlencode}}">{{tag}}</a>&nbsp;
			{%endfor%}
		</p>
		{%endif%}
	</div>
	
	<!-- related-posts end -->
	{% endif %}
	
	
	<!-- postnavi start -->
	<div class="postnavi box">
		{%for prev in entry.prev%}
		<p class="prev right"><a href="/{{prev.link}}">{{prev.title}}</a></p>
		{%endfor%}
		{%for next in entry.next%}
		<p class="next left"><a href="/{{next.link}}">{{next.title}}</a></p>
		{%endfor%}
		<div class="clear"></div>
	</div>
	
	{% if relateposts %}
	<div class="postnavi box">
		<h5>相关文章</h5>
		<ul>
		{%for post in relateposts%}
			<li><a href="/{{post.link|escape}}">{{post.title|escape}}</a> - {{post.date|datetz:"Y/m/d"}}</li>
		{%endfor%}
		</ul>
	</div>
	{% endif %}
	
	<!-- postnavi end -->
	{% include "comments.html" %}
	
</div>
<!-- content end -->
{% include "sidebar.html" %}
{% endblock %}
